#include <stdio.h>
#include <stdlib.h>
int main()
{
    freopen("in.txt","r",stdin);
    int a,x,t,m;
    m = 0;
    scanf("%d",&x);
    t=x;
    a=x;
    int cnt=0;
    while (x>0)
    {
        t=x%10;
        x=x/10;
        m=m*10+t;
        cnt++;
    }
 printf("%d\n",cnt);
 int a1,a2,a3,a4,a5;
 if(a>9999){
  a1=a/10000;
   printf("%d ",a1);
  a2=a/1000-a1*10;
   printf("%d ",a2);
  a3=a/100-a1*100-a2*10;
   printf("%d ",a3);
  a4=a/10-a1*1000-a2*100-a3*10;
   printf("%d ",a4);
  a5=a-a1*10000-a2*1000-a3*100-a4*10;
   printf("%d",a5);
 }
 else if(a>999){
  a1=a/1000;
   printf("%d ",a1);
  a2=a/100-a1*10;
   printf("%d ",a2);
  a3=a/10-a1*100-a2*10;
   printf("%d ",a3);
  a4=a-a1*1000-a2*100-a3*10;
   printf("%d",a4);
 }
 else if(a>99){
  a1=a/100;
   printf("%d ",a1);
  a2=a/10-a1*10;
   printf("%d ",a2);
  a3=a-a1*100-a2*10;
   printf("%d",a3);
 }
 else if(a>9){
  a1=a/10;
   printf("%d ",a1);
  a2=a-a1*10;
   printf("%d",a2);
 }
 else{
  printf("%d",a);
 }
 printf("\n");
 printf("%d",m);
    return 0;
}